package demo.consumer;


import demo.delay.KafkaDelayListener;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;


@Component
public class OmsConsumer {

    private Logger logger = LoggerFactory.getLogger(OmsConsumer.class);

    @KafkaDelayListener(channelName = "output-channel", topic = "topic-name", delayTimeSec = 10000, pauseTimeSec = 1000)
    public void inputChannel(ConsumerRecord<String,String> record) {

        logger.info("开始消费信道 1 消息:{}", record.value());

        if(Integer.parseInt(record.value()) < 5){
            throw new RuntimeException("1");
        }
    }


}
